//
//  YKMainViewController.m
//  1935COF
//
//  Created by CCY on 16/4/23.
//  Copyright © 2016年 yk. All rights reserved.
//

#import "YKMainViewController.h"
#define MyScreenH [UIScreen mainScreen].bounds.size.height

#define MyScreenW [UIScreen mainScreen].bounds.size.width

#define ScreenH self.view.frame.size.height

#define ScreenW self.view.frame.size.width
@interface YKMainViewController ()

@end

@implementation YKMainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setBackground];
    
    //[self setbtn];
    
}

-(void)setbtn{
    
    CGFloat y = ScreenH *0.15;
    
    for (int i = 0; i<3; i++) {
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        
        [btn setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"main_c%d",i + 1]] forState:UIControlStateNormal];
        
        btn.frame = CGRectMake(0.2 * ScreenW, y + i * (y + ScreenH *0.1) , ScreenW *0.8, 100);
        
        [self.view addSubview:btn];
        
    }
}

-(void)setBackground{
    
        self.view.backgroundColor =[UIColor whiteColor];
    
        UIImageView *imageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"main_bg"]];
    
        imageV.frame = self.view.bounds;
    
        imageV.userInteractionEnabled =YES;
    
        [self.view addSubview:imageV];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
